import DateUtils from '@/utils/date'
const dateTool = new DateUtils()
export function useCountdownTime(startTime: string, timeOut: number | string) {
  if (!timeOut) return 0
  const createDate = dateTool.getTime(startTime)
  const timeDifference = createDate + Number(timeOut) * 1000 - new Date().getTime()
  return timeDifference > 0 ? timeDifference : 0
}
